# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kimap
pkgver=23.08.4
pkgrel=0
pkgdesc="Job-based API for interacting with IMAP servers"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	cyrus-sasl-dev
	kcoreaddons5-dev
	ki18n5-dev
	kio5-dev
	kmime-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
_repo_url="https://invent.kde.org/pim/kimap.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kimap-$pkgver.tar.xz"
subpackages="$pkgname-dev"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# loginjobtest is broken
	ctest --test-dir build --output-on-failure -E "loginjobtest" -j1
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bc7f195fdc362ad52064135a65b84d8808100042acf818006ee8500abcb7a2d32d841e0cc6196bff529bc7c4348aa3e90dc7e2256fd908ebd62f35211f0b1dd4  kimap-23.08.4.tar.xz
"
